// 2493
package L3;

import java.util.Scanner;

public class TestBMI {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Please enter height(m):");
        double h = scanner.nextDouble();
        System.out.println("Please enter weight(kg):");
        double w = scanner.nextDouble();
        scanner.close();

        BMI bmi = new BMI(h,w);
        bmi.show();
        
    }
}

class BMI {
    private double height;
    private double weight;
    BMI(){}
    BMI(double h, double w) {
        height = h;
        weight = w;
    }
    public double getBMI() {
        return weight / (height * height);
    }
    public static String assessBMI(double bmi){
        if (bmi < 18.5f) {
            return "Low weight";
        } else if (bmi >= 18.5f && bmi < 24.0f) {
            return "Normal weight";
        } else if (bmi >= 24.0f && bmi < 28.0f) {
            return "Overweight";
        } else {
            return "Fat or Obesity";
        }
    }
    public void show() {
        double bmi = getBMI();
        System.out.println(
            String.format("height %.2fm, weight %.1fkg, BMI is %.15f, %s",
             height, weight,bmi,assessBMI(bmi))
        );
    }
}
